{layout name="passport:main" /}
<div class="tipbox tipbox-message">
    <span class="fn-f14 fn-fb red">注意：</span><br />
    1、审核功能的数据全部提交给微信官方<br />
    2、本页面展示的页面目录和页面路径全部来自微信官方
</div>
<form id="form" action="{:url('system/passport.miniapp/addpass')}">
    <input type="hidden" name="id" value="{$id}" />
    <table class="pure-table">
        <tr>
            <td>页面路径(一):</td>
            <td>
                <select datatype="*" name="page[0]" class="select w300">
                    <option value="">请选择页面路径</option>
                    {foreach $page as $path} <option value="{$path}">{$path}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr><td class="w120">页面名称:</td><td><input datatype="*" class="input fn-left" type="text" name="name[0]" value="" /></td></tr>
        <tr>
            <td>页面目录:</td>
            <td>
                <select datatype="*" name="cate[0]" class="select w300">
                    <option value="">请选择页面路目录</option>
                    {foreach $cate as $key => $vo }<option value="{$key}">{$vo.name}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td>页面标签:</td>
            <td>
                <input datatype="*" class="input w500" type="text" name="tag[0]" value="" /><br />
                <span class="gray fn-f12">多个标签用空格分隔，标签不能多于10个，标签长度不超过20</span>
            </td>
        </tr>
        <tr>
            <th></th>
            <td>
                <input type="submit" value="提交小程序给微信审核"" class="button button-blue submit" />
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
Do('base','layer','form',function(){
    var index = parent.layer.getFrameIndex(window.name);
    $("#form").Validform({
        btnSubmit:".submit",ajaxPost:true,tiptype:4,postonce:true,
        callback:function(data){
            if(data.code == 200){
                parent.layer.alert(data.msg,{icon:1},function(alertIndex){
                    parent.layer.close(alertIndex);
                    parent.layer.close(index);
                    parent.$("#iframe")[0].src = data.url
                });
            }else{
                parent.layer.alert(data['msg'],{icon:5})
            }
        }
    });
})
</script>